#pragma once

#include <math/Rect.h>
#include <math/Vector2.h>

#include <Signals.h>

namespace liba {

class Object2D
{
public:
	virtual ~Object2D() { }
	/** Returns global AABB bounding box for this object */
	virtual math::Rect<float> GetGlobalBounds() = 0;
	virtual float GetZ() = 0;

	virtual math::Vector2<float> GlobalToLocal(const math::Vector2<float>& pt) = 0;
	virtual math::Vector2<float> LocalToGlobal(const math::Vector2<float>& pt) = 0;

	signals::signal<void ()>& BoundsChanged() { return this->boundsChanged; }
	signals::signal<void ()>& Destroying() { return this->destroying; }
protected:
	void FireBoundsChanged() { this->boundsChanged(); }
	void FireDestroying() { this->destroying(); }
private:
	signals::signal<void ()> boundsChanged;
	signals::signal<void ()> destroying;
};

} // namespace liba